import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: {title: '自述文件'},
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: {title: '系统首页'}
                },
                {
                    path: '/addErrand',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/AddErrand.vue'),
                    meta: {title: '出差信息增添'}
                },
                {
                    path: '/emp',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Emp'),
                    meta: {title: '员工管理'}
                },
                {
                    path: '/post',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Post.vue'),
                    meta: {title: '岗位管理'}
                },
                {
                    path: '/dept',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Dept.vue'),
                    meta: {title: '部门管理'}
                },
                {
                    path: '/errand',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Errand.vue'),
                    meta: {title: '出差管理'}
                },
                {
                    path: '/resource',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Resource.vue'),
                    meta: {title: '资源管理'}
                },
                {
                    path: '/role',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Role.vue'),
                    meta: {title: '权限管理'}
                },  {
                    path: '/addrole',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/AddRole.vue'),
                    meta: {title: '角色添加'}
                },
                {
                    path: '/salary',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Salary.vue'),
                    meta: {title: '薪资管理'}
                },
                {
                    path: '/notice',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Notice.vue'),
                    meta: {title: '通知管理'}
                },
                {
                    // 通知修改
                    path: '/addNotice',
                    component: () => import(/* webpackChunkName: "markdown" */ '../components/page/AddNotice.vue'),
                    meta: {title: '添加通知'}
                },
                {
                    path: '/icon',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Icon.vue'),
                    meta: {title: '自定义图标'}
                },
                {
                    path: '/table',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/BaseTable.vue'),
                    meta: {title: '基础表格'}
                },
                {
                    path: '/tabs',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/Tabs.vue'),
                    meta: {title: '通知'}
                },
                {
                    path: '/form',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/BaseForm.vue'),
                    meta: {title: '基本表单'}
                },
                {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: () => import(/* webpackChunkName: "editor" */ '../components/page/VueEditor.vue'),
                    meta: {title: '富文本编辑器'}
                },
                {
                    // markdown组件
                    path: '/markdown',
                    component: () => import(/* webpackChunkName: "markdown" */ '../components/page/Markdown.vue'),
                    meta: {title: 'markdown编辑器'}
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: () => import(/* webpackChunkName: "upload" */ '../components/page/Upload.vue'),
                    meta: {title: '文件上传'}
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: () => import(/* webpackChunkName: "chart" */ '../components/page/BaseCharts.vue'),
                    meta: {title: 'schart图表'}
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: () => import(/* webpackChunkName: "drag" */ '../components/page/DragList.vue'),
                    meta: {title: '拖拽列表'}
                },
                {
                    // 拖拽Dialog组件
                    path: '/dialog',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/DragDialog.vue'),
                    meta: {title: '拖拽弹框'}
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Permission.vue'),
                    meta: {title: '权限测试', permission: true}
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: {title: '404'}
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: {title: '403'}
                },
                {
                    path: '/empAdd',
                    component: () => import('../components/page/EmpAdd.vue'),
                    meta: {title: '添加员工'}
                },
                {
                    path: '/empParticulars/:empId',
                    component: () => import('../components/page/EmpParticulars.vue'),
                    meta: {title: '员工详情'}
                },
                {
                    path: '/operLog',
                    component: () => import('../components/page/OperLog.vue'),
                    meta: {title: '日志管理'}
                },
                {
                    path: '/sql',
                    component: () => import('../components/page/Sql.vue'),
                    meta: {title: 'sql监控'}
                },
                {
                    path: '/operLog',
                    component: () => import('../components/page/OperLog.vue'),
                    meta: {title: '日志管理'}
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: {title: '登录'}
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
